package com.rd.student.jiaji.class4.suyan.zrrd.day03;
//位运算符
public class Demo05 {

    public static void main(String[] args) {
        int i=7;
        int i1=6;
        System.out.println(i&i1);
        System.out.println(i|i1);
        System.out.println(i^i1);
        i=9;

        System.out.println(~i);//-10
        //运算规则，理解为左移几位就相当于乘以2的几次方
        i=9;
        System.out.println(i<<2);
        i=-1;
        System.out.println(i<<2);
        //运算规则，理解为右移几位就相当于除以2的几次方
        i=9;
        System.out.println(i>>3);//1
        i=-9;
        System.out.println(i>>3);
    }
}
